Ext.define('A5T.view.mywin.LeftMenu', {
    title: '菜单',
    region:'west',
    extend:'Ext.panel.Panel',
    margins: '0 5 5 5',
    width: 200,
    collapsible: true,   // make collapsible
    id: 'west-region-container',
    layout: 'fit',
    items:[{
        xtype:'panel',
        
        defaults: {
            // applied to each contained panel
            bodyStyle: 'padding:0px'
        },
        layout: {
            // layout-specific configs go here
            type: 'accordion',
            titleCollapse: false,
            animate: true,
            activeOnTop: true
        },
        items: [{
                    title: 'Panel 1',
                    items:[{
                    xtype: 'button',
                    handler: function(button, e) {
                        var centerTab = Ext.getCmp('centerTab');
                        var tab = Ext.getCmp('deploymentedTab');
                        if(tab)
                        {
                            centerTab.setActiveTab(tab);
                            return;
                        }
                        centerTab.add({
                            title: '已部署流程',
                            id:'deploymentedTab',
                            extend:'Ext.panel.Panel',
                            closable: true,
                            width:1200,
                            layout: 'fit',
                            initComponent:function(){
                                var me = this;
                                var deploymentGrid = Ext.create('A5T.view.mywin.DeploymentGrid');
                                me.items = [deploymentGrid];
                                me.superclass.initComponent.call(me);
                            }
                        });
                    },
                    itemId: 'deploymentedBtn',
                    text: '已部署流程'
                },
                {
                    xtype: 'button',
                    handler: function(button, e) {
                        var centerTab = Ext.getCmp('centerTab');
                        var tab = Ext.getCmp('piedTab');
                        if(tab)
                        {
                            centerTab.setActiveTab(tab);
                            return;
                        }
                        centerTab.add({
                            title: '已启动流程实例',
                            id:'piedTab',
                            extend:'Ext.panel.Panel',
                            closable: true,
                            width:1200,
                            layout: 'fit',
                            initComponent:function(){
                                var me = this;
                                var pisGrid = Ext.create('A5T.view.mywin.PisGrid');
                                me.items = [pisGrid];
                                me.superclass.initComponent.call(me);
                            }
                        });
                    },
                    text: '已启动流程实例'
                }]
        },{
            title: 'Panel 2',
            html: 'Panel content!'
        }]
    }]
    
});